PACKAGE = gitee.com/xuender/bindgen
VERSION = $(shell git describe --tags)
BUILD_TIME = $(shell date +%F' '%T)

default: lint-fix test

tools:
	go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
	go install github.com/goreleaser/goreleaser/v2@latest

lint:
	golangci-lint run --timeout 60s --max-same-issues 50 ./...

lint-fix:
	golangci-lint run --timeout 60s --max-same-issues 50 --fix ./...

test:
	go test -race -v ./... -gcflags=all=-l -cover

clean:
	rm -rf dist

proto:
	protoc --go_out=_example _example/pb/*.proto

build:
	goreleaser build --snapshot --clean
	cp dist/bindgen_linux_amd64_v1/bindgen ~/bin
